import 'package:flutter/material.dart';
import '../../share/my_color.dart';
import '../../share/my_font.dart';
import '../../share/size_fill.dart';

//展示列表最下面的按钮
class ShowBottomButtonWidget extends StatelessWidget {
  final Color bgColor;
  final Color textColor;
  final String text;
  double? height;
  double? radius;
  double? width;
  final Function onTap;
  Color? eColor;

  ShowBottomButtonWidget({
    Key? key,
    required this.text,
    this.bgColor = MyColors.color_43_44_48,
    this.textColor = MyColors.color_255_255_255,
    this.width,
    this.height,
    this.radius,
    this.eColor,
    required this.onTap,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    if (width == null) {
      width = SizeFill.setRx(280);
    }
    if (height == null) {
      height = SizeFill.setRx(48);
    }
    if (radius == null) {
      radius = SizeFill.setRx(24);
    }
    if (this.eColor == null) {
      this.eColor = Color.fromARGB(53, 206, 195, 208);
    }
    return SafeArea(
      child: InkWell(

        onTap: () {
          if (onTap != null) {
            onTap();
          }
        },
        child: Container(
          alignment: Alignment.center,
          margin: EdgeInsets.symmetric(vertical: SizeFill.setRx(15)),
          width: width,
          height: height,
          decoration: BoxDecoration(borderRadius: BorderRadius.circular(radius!), color: bgColor, boxShadow: [
            BoxShadow(
              color: eColor!,
              offset: Offset(0, 3),
              blurRadius: SizeFill.setRx(6),
              spreadRadius: SizeFill.setRx(0),
            )
          ]),
          child: Text(
            text,
            style: TextStyle(
              color: textColor,
              fontSize: MyFont.font17,
            ),
          ),
        ),
      ),
    );
  }
}
